package ua.edu.nuos.jeetraining2012.cms.dto;

import java.io.Serializable;

/**
 * DTO class for Google Calendar.
 * The only one field is required for success calendar creation.
 *
 * @author Victor N. Ganichev victor.ganichev@gmail.com
 * @version 1.0 Date: 24.07.13 Time: 15:18
 * @since 1.0
 */
public class GoogleCalendarDTO implements Serializable {

    /** Define calendar ID.*/
    private String calendarId;

    /** Define calendar name. Also knows as summary in Google Calendar API.*/
    private String calendarName;

    /** Define calendar Time Zone. Sth like 'America/Los_Angeles'. */
    private String calendarTimeZone;

    /** Define calendar description. */
    private String calendarDescription;

    /** Define geographical calendar location. */
    private String calendarLocation;

    // Constructors

    public GoogleCalendarDTO() {}

    // Getters & Setters

    public String getCalendarId() {
        return calendarId;
    }

    public void setCalendarId(String calendarId) {
        this.calendarId = calendarId;
    }

    public String getCalendarName() {
        return calendarName;
    }

    public void setCalendarName(String calendarName) {
        this.calendarName = calendarName;
    }

    public String getCalendarTimeZone() {
        return calendarTimeZone;
    }

    public void setCalendarTimeZone(String calendarTimeZone) {
        this.calendarTimeZone = calendarTimeZone;
    }

    public String getCalendarDescription() {
        return calendarDescription;
    }

    public void setCalendarDescription(String calendarDescription) {
        this.calendarDescription = calendarDescription;
    }

    public String getCalendarLocation() {
        return calendarLocation;
    }

    public void setCalendarLocation(String calendarLocation) {
        this.calendarLocation = calendarLocation;
    }

    // Overrides
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        GoogleCalendarDTO that = (GoogleCalendarDTO) o;

        if (calendarId != null ? !calendarId.equals(that.calendarId) : that.calendarId != null) return false;
        if (!calendarName.equals(that.calendarName)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = calendarId != null ? calendarId.hashCode() : 0;
        result = 31 * result + calendarName.hashCode();
        return result;
    }

    @Override
    public String toString() {
        return "GoogleCalendarDTO{" +
                "calendarId='" + calendarId + '\'' +
                ", calendarName='" + calendarName + '\'' +
                ", calendarTimeZone='" + calendarTimeZone + '\'' +
                ", calendarDescription='" + calendarDescription + '\'' +
                ", calendarLocation='" + calendarLocation + '\'' +
                '}';
    }
}
